package com.bd03.streaminglearn.day0402.test

import redis.clients.jedis.{Jedis, JedisPool, JedisPoolConfig}

object JedisPoolDemo {
  private val config = new JedisPoolConfig

  config.setMaxIdle(50)//最大空闲数
  config.setMaxTotal(500)//最大链接数
  config.setMaxWaitMillis(-1)//最大等待时间

  private val pool = new JedisPool(config,"hdp01")

  def getResource():Jedis={
    val resource = pool.getResource
    resource.select(2)
    resource
  }

}
